<?php

namespace app\model;

use think\Model;

class UserFactory extends Model
{
    const IS_DELETE_NO = 0;

    /**
     * @Description 根据用户id 获取用户管理猪厂数
     * @author: zj
     * @param int $userId
     * @time 2023/08/31 11:35:58
     * @return int
     * @throws \think\db\exception\DbException
     */
    public function checkUserFactoryNum(int $userId)
    {
        return $this->where("user_id",$userId) -> count() ?? 0;
    }
}